/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Robot;

import lejos.robotics.subsumption.Behavior;

/**
 *
 * @author zach
 */
public class Turn implements Behavior{

    public boolean takeControl() {
        return Constants.conditionCode==Constants.isLCorner||Constants.conditionCode==Constants.isRconner;
    }

    public void action() {
        if(Constants.isleft){
            Configureation.getPilot().rotate(90);
        }else{
            Configureation.getPilot().rotate(-90);
        }
        Configureation.getPilot().travel(100f);
        Constants.isleft=!Constants.isleft;
        Constants.conditionCode=0;
    }

    public void suppress() {
    }

}
